<template>
  <h2>Consumer组件，接受到的消息：{{ msg }}</h2>
</template>

<script setup>
import {ref} from "vue";
import {emitter} from "./MittInstance.js";

const msg = ref("还没有收到消息哟")
// 在组件中监听事件
emitter.on('yourCustomEventType', (data) => {
  console.log('Consumer组件收到消息：', data.message)
  msg.value = data.message
})

</script>

<style scoped>

</style>